feat(test-utils): Add vitest infrastructure with browser commands#10064
Open
chrisgervang wants to merge 9 commits intochr/test-utils-vitest-entryfrom
Open
feat(test-utils): Add vitest infrastructure with browser commands#10064chrisgervang wants to merge 9 commits intochr/test-utils-vitest-entryfrom
chrisgervang wants to merge 9 commits intochr/test-utils-vitest-entryfrom
Conversation
377c434 to
6405bc2
Compare
f32303d to
b3812bc
Compare
c6b6e8c to
63446d4
Compare
b3812bc to
b49edc7
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
b30d4db to
41e35a3
Compare
9211999 to
c337c4e
Compare
Add vitest configuration and setup files for running tests: - vitest.config.ts with node/scripts/headless/browser/render projects - test/setup/vitest-node-setup.ts with JSDOM polyfills and typed array equality - test/setup/vitest-browser-setup.ts with browser test driver bridge - test/setup/browser-commands.ts with captureAndDiffScreen and emulateInput - test/setup/vitest-browser-commands.d.ts with TypeScript declarations Add package.json scripts: test-headless, test-render, test-browser, test-ci Add devDependencies: @vitest/browser-playwright, @vitest/coverage-v8, @probe.gl/test-utils, pixelmatch, playwright, pngjs, sharp Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Reduces code duplication between vitest-node-setup.ts and vitest-browser-setup.ts by extracting to typed-array-equality.ts. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Change import from @vitest/browser/context to vitest/browser to fix deprecation warning in newer vitest versions. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… browser project - Add vitest/browser to optimizeDepsConfig to prevent flaky tests - Remove test/render/**/*.spec.ts from browser project (use render project instead) - Add clarifying comments throughout config Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use node project which includes test/smoke/**/*.spec.ts Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1e3b04e to
eb67e83
Compare
The polyfills package has .node extension files that vitest/ESM cannot resolve. JSDOM already provides the browser APIs that polyfills would provide (TextEncoder, TextDecoder, atob, btoa, etc.) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Tests both node and headless browser environments in smoke test to verify vitest infrastructure works end-to-end. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
felixpalmer
approved these changes
Mar 10, 2026
Resolved 6 conflicted files by taking the more mature incoming implementations while preserving our test-vitest-smoke script and smoke test includes: - package.json: Adopt incoming vitest-based test/test-fast/test-ci scripts, keep test-vitest-smoke with --project headless - vitest.config.ts: Take incoming SwiftShader args, excludedTests, separate headless/browser providers, coverage config; keep smoke test glob in node project - browser-commands.ts: Take incoming diagnostic capture, smarter canvas selection, Playwright keyboard API - vitest-browser-commands.d.ts: Add diagnostic command types - vitest-node-setup.ts: Use CJS workaround for @loaders.gl/polyfills - yarn.lock: Accept incoming, reconciled with yarn install - .ocularrc.js: Fix duplicate tape-compat entry, rename .spec.ts back to .ts so vitest doesn't pick up the tape test Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds comprehensive vitest infrastructure for multi-environment testing: Node.js, scripts, headless browser (JSDOM), real browser (Playwright), and visual regression testing.
Change List
Closes #
Note
Medium Risk
Moderate risk because it changes test runner configuration and what test files are executed in CI, which could cause unexpected failures or coverage changes.
Overview
Updates test configuration to better align smoke tests with Vitest.
Fixes the Ocular
tape-compatentry to point attest/smoke/tape-compat.ts(and removes the duplicate entry), adds atest-vitest-smokescript inpackage.json, and expands the Vitestnodeproject to also runtest/smoke/**/*.spec.ts.Written by Cursor Bugbot for commit 64f3473. This will update automatically on new commits. Configure here.